from flask import Flask
from celery import Celery

app = Flask(__name__)
#配置Celery

celery = Celery(app.name,
             backend='redis://localhost:6379/0',
             broker='redis://localhost:6379/0')

# 创建任务函数
@celery.task(bind=True)
def my_task():
    print("任务函数正在执行....")

# @app.route('/')
# def hello_world():
#     return 'Hello World!'


if __name__ == '__main__':
    app.run(debug=True)
